axios.interceptors.request.use(
    config => {
        config.headers['X-Requested-With'] = 'XMLHttpRequest';
        return config;
    },
    error => {
        return Promise.reject(error.response);
    });
axios.interceptors.response.use(
    response => {
        debugger;
        if (response.data.code === 0) {
            alert(response.data.msg);
            return;
        } else {
            return response;
        }
    },
    error => {
        return Promise.reject(error.response)   // 返回接口返回的错误信息
    });